
from flask import Flask, make_response,request


app = Flask(__name__)
app.secret_key = '123456'

@app.route('/')
def home():
    return 'Hello World!'

@app.route('/set_cookie')
def set_cookie():
    resp = make_response('success')
    resp.set_cookie('username', 'admin', max_age=3600)

    return resp
@app.route('/get_cookie')
def get_cookie():
    username = request.cookies.get('username')
    return f'Hello, {username}!'

@app.route('/delete_cookie')
def delete_cookie():
    resp = make_response('success')
    resp.delete_cookie('username')

    return resp
if __name__ == '__main__':
    app.run(debug=True)